package org.zdc.pivot.wtk;
import nme.events.TimerEvent;
import nme.net.URLRequest;
import nme.utils.Timer;
import org.zdc.core.Version;

class ApplicationContext 
{
	private static var orign:URLRequest = null;
	private static var dispLays:Array<Display> = new Array<Display>();
	private static var applications:Array<IApplication> = new Array<IApplication>();
	
	private static var resourceCache = new nme.ObjectHash<URLRequest, Dynamic>();
	private static var resourceCacheDictionary = new nme.ObjectHash<URLRequest, Dynamic>();
	
	private static var pivotVersion:Version = null;
	
	public function new() 
	{
		
	}
	
	public static function getOrigin():URLRequest {
		return orign;
	}
	
	public static function getResourceCache():nme.ObjectHash<URLRequest, Dynamic> {
		return resourceCacheDictionary;
	}
	
	public static function applyStylesheet(resourceName:String):Void {
		
	}
	
	public static function scheduleCallback(func:Dynamic, delay:Int):Timer {
		var timer:Timer = new Timer(delay, 1);
		timer.addEventListener(TimerEvent.TIMER_COMPLETE, func);
		timer.start();
		return timer;
	}
}